<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateBuildingTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <p:colorPicker id="color" showControls="true"/>
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateBuildingLabel_area}" for="area" />
                    <h:selectOneMenu id="area" value="#{buildingController.selected.area}" title="#{bundle.CreateBuildingTitle_area}" >
                        <f:selectItems value="#{areaController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateBuildingLabel_flors}" for="flors" />
                    <h:inputText id="flors" value="#{buildingController.selected.flors}" title="#{bundle.CreateBuildingTitle_flors}" />
                    <h:outputLabel value="#{bundle.CreateBuildingLabel_name}" for="name" />
                    <h:inputText id="name" value="#{buildingController.selected.name}" title="#{bundle.CreateBuildingTitle_name}" />
                    <h:outputLabel value="#{bundle.CreateBuildingLabel_number}" for="number" />
                    <h:inputText id="number" value="#{buildingController.selected.number}" title="#{bundle.CreateBuildingTitle_number}" />
                    <h:outputLabel value="#{bundle.CreateBuildingLabel_id}" for="id" />
                    <h:outputLabel id="id" value="#{buildingController.selected.id}" title="#{bundle.CreateBuildingTitle_id}" />
                </h:panelGrid>
                <br />
                <h:commandLink action="#{buildingController.create}" value="#{bundle.CreateBuildingSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{buildingController.prepareList}" value="#{bundle.CreateBuildingShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.CreateBuildingIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
